#ifndef  _FLAPP_T_H_H_
#define  _FLAPP_T_H_H_
#include <stdint.h>

void flapp_t_h_init(void);
void flapp_t_h_run(void);

//               7654 3210
// Polynomial 0b 1000 1001 ~ x^7+x^3+x^0
//            0x    8    9
#define CRC7WIDTH  7    					// A 7 bits CRC has polynomial of 7th order, which has 8 terms
#define CRC7POLY   0x89 					// The 8 coefficients of the polynomial
#define CRC7IVEC   0x7F 					// Initial vector has all 7 bits high
// Payload data
#define DATA7WIDTH 17
#define DATA7MASK  ((1UL<<DATA7WIDTH)-1) 	// 0b 0 1111 1111 1111 1111
#define DATA7MSB   (1UL<<(DATA7WIDTH-1)) 	// 0b 1 0000 0000 0000 0000

#endif

